package com.czkevin.exampleplugin;
import org.bukkit.Material;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
public class SitShit extends JavaPlugin {
    @Override
    public void onEnable() {
        getLogger().info("插件已加载");
        new BukkitRunnable() {
            @Override
            public void run() {
                for(var p : getServer().getOnlinePlayers()) {
                    if(p.isSneaking()) {
                        p.getWorld().dropItemNaturally(p.getLocation(), new org.bukkit.inventory.ItemStack(Material.GOLD_INGOT) {{
                            var meta = getItemMeta();
                            meta.setDisplayName("§4狗屎");
                            setItemMeta(meta);
                        }});
                    }
                }
            }
        }.runTaskTimer(this, 0, 10L);
    }
    @Override
    public void onDisable() {
        getLogger().info("插件已卸载");
    }
}
